<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>tango.time.chrono.Gregorian</title>
  <link href="./css/style.css" rel="stylesheet" type="text/css"/>
  <!-- <link href="./img/icon.png" rel="icon" type="image/png"/> -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/modules.js"></script>
  <script type="text/javascript" src="./js/quicksearch.js"></script>
  <script type="text/javascript" src="./js/navigation.js"></script>
  <!--<script type="text/javascript" src="./js/jquery.treeview.js"></script>-->
  <script type="text/javascript">
    var g_moduleFQN = "tango.time.chrono.Gregorian";
  </script>
  
</head>
<body>
<div id="content">
  <h1><a href="./htmlsrc/tango.time.chrono.Gregorian.html" class="symbol">tango.time.chrono.Gregorian</a></h1>
  
<p class="sec_header">License:</p>BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a>
<p class="sec_header">Version:</p>Mid 2005: Initial release
                        Apr 2007: reshaped
<p class="sec_header">Author:</p>John Chapman, Kris, schveiguy
<dl>
<dt class="decl">class <a class="symbol _class" name="Gregorian" href="./htmlsrc/tango.time.chrono.Gregorian.html#L31" kind="class" beg="31" end="452">Gregorian</a> : Calendar; <a title="Permalink to this symbol" href="#Gregorian" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.chrono.Gregorian.html#L31">#</a></dt>
<dd class="ddef">
<div class="summary"><a name="_Gregorian"></a>
 Represents the Gregorian calendar.</div>
Note that this is the Proleptic Gregorian calendar.  Most calendars assume
 that dates before 9/14/1752 were Julian Dates.  Julian differs from
 Gregorian in that leap years occur every 4 years, even on 100 year
 increments.  The Proleptic Gregorian calendar applies the Gregorian leap
 year rules to dates before 9/14/1752, making the calculation of dates much
 easier.
<dl>
<dt class="decl">Gregorian <a class="symbol _variable" name="Gregorian.generic" href="./htmlsrc/tango.time.chrono.Gregorian.html#L37" kind="variable" beg="37" end="37">generic</a>; <span class="attrs">[<span class="prot">public</span>, <span class="stc">static</span>]</span> <a title="Permalink to this symbol" href="#Gregorian.generic" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.chrono.Gregorian.html#L37">#</a></dt>
<dd class="ddef">
<div class="summary">static shared instance</div></dd>
<dt class="decl"><a class="symbol _enum" name="Gregorian.enum" href="./htmlsrc/tango.time.chrono.Gregorian.html#L54" kind="enum" beg="54" end="54">enum</a>; <a title="Permalink to this symbol" href="#Gregorian.enum" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.chrono.Gregorian.html#L54">#</a></dt>
<dd class="ddef">
<div class="summary">Represents the current era.</div>
</dd>
<dt class="decl">static <a class="symbol _sctor" name="Gregorian.this" href="./htmlsrc/tango.time.chrono.Gregorian.html#L63" kind="sctor" beg="63" end="66">this</a>(); <a title="Permalink to this symbol" href="#Gregorian.this" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.chrono.Gregorian.html#L63">#</a></dt>
<dd class="ddef">
<div class="summary">create a generic instance of this calendar</div></dd>
<dt class="decl"><a class="symbol _ctor" name="Gregorian.this:2" href="./htmlsrc/tango.time.chrono.Gregorian.html#L72" kind="ctor" beg="72" end="75">this</a><span class="params">(Type <em>type</em> = Type.Localized)</span>; <a title="Permalink to this symbol" href="#Gregorian.this:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.chrono.Gregorian.html#L72">#</a></dt>
<dd class="ddef">
<div class="summary">Initializes an instance of the Gregorian class using the specified GregorianTypes value. If no value is 
 specified, the default is Gregorian.Types.Localized.</div></dd>
<dt class="decl">Time <a class="symbol _function" name="Gregorian.toTime" href="./htmlsrc/tango.time.chrono.Gregorian.html#L90" kind="function" beg="90" end="93">toTime</a><span class="params">(uint <em>year</em>, uint <em>month</em>, uint <em>day</em>, uint <em>hour</em>, uint <em>minute</em>, uint <em>second</em>, uint <em>millisecond</em>, uint <em>era</em>)</span>; <span class="attrs">[<span class="stc">override</span>]</span> <a title="Permalink to this symbol" href="#Gregorian.toTime" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.chrono.Gregorian.html#L90">#</a></dt>
<dd class="ddef">
<div class="summary">Overridden. Returns a Time value set to the specified date and time in the specified _era.</div>
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>year</em></td><td>An integer representing the _year.</td></tr>
<tr><td><em>month</em></td><td>An integer representing the _month.</td></tr>
<tr><td><em>day</em></td><td>An integer representing the _day.</td></tr>
<tr><td><em>hour</em></td><td>An integer representing the _hour.</td></tr>
<tr><td><em>minute</em></td><td>An integer representing the _minute.</td></tr>
<tr><td><em>second</em></td><td>An integer representing the _second.</td></tr>
<tr><td><em>millisecond</em></td><td>An integer representing the _millisecond.</td></tr>
<tr><td><em>era</em></td><td>An integer representing the _era.</td></tr></table>
<p class="sec_header">Returns:</p>A Time set to the specified date and time.</dd>
<dt class="decl">DayOfWeek <a class="symbol _function" name="Gregorian.getDayOfWeek" href="./htmlsrc/tango.time.chrono.Gregorian.html#L100" kind="function" beg="100" end="114">getDayOfWeek</a><span class="params">(Time <em>time</em>)</span>; <span class="attrs">[<span class="stc">override</span>]</span> <a title="Permalink to this symbol" href="#Gregorian.getDayOfWeek" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.chrono.Gregorian.html#L100">#</a></dt>
<dd class="ddef">
<div class="summary">Overridden. Returns the day of the week in the specified Time.</div>
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>time</em></td><td>A Time value.</td></tr></table>
<p class="sec_header">Returns:</p>A DayOfWeek value representing the day of the week of time.</dd>
<dt class="decl">uint <a class="symbol _function" name="Gregorian.getDayOfMonth" href="./htmlsrc/tango.time.chrono.Gregorian.html#L121" kind="function" beg="121" end="124">getDayOfMonth</a><span class="params">(Time <em>time</em>)</span>; <span class="attrs">[<span class="stc">override</span>]</span> <a title="Permalink to this symbol" href="#Gregorian.getDayOfMonth" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.chrono.Gregorian.html#L121">#</a></dt>
<dd class="ddef">
<div class="summary">Overridden. Returns the day of the month in the specified Time.</div>
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>time</em></td><td>A Time value.</td></tr></table>
<p class="sec_header">Returns:</p>An integer representing the day of the month of time.</dd>
<dt class="decl">uint <a class="symbol _function" name="Gregorian.getDayOfYear" href="./htmlsrc/tango.time.chrono.Gregorian.html#L131" kind="function" beg="131" end="134">getDayOfYear</a><span class="params">(Time <em>time</em>)</span>; <span class="attrs">[<span class="stc">override</span>]</span> <a title="Permalink to this symbol" href="#Gregorian.getDayOfYear" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.chrono.Gregorian.html#L131">#</a></dt>
<dd class="ddef">
<div class="summary">Overridden. Returns the day of the year in the specified Time.</div>
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>time</em></td><td>A Time value.</td></tr></table>
<p class="sec_header">Returns:</p>An integer representing the day of the year of time.</dd>
<dt class="decl">uint <a class="symbol _function" name="Gregorian.getMonth" href="./htmlsrc/tango.time.chrono.Gregorian.html#L141" kind="function" beg="141" end="144">getMonth</a><span class="params">(Time <em>time</em>)</span>; <span class="attrs">[<span class="stc">override</span>]</span> <a title="Permalink to this symbol" href="#Gregorian.getMonth" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.chrono.Gregorian.html#L141">#</a></dt>
<dd class="ddef">
<div class="summary">Overridden. Returns the month in the specified Time.</div>
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>time</em></td><td>A Time value.</td></tr></table>
<p class="sec_header">Returns:</p>An integer representing the month in time.</dd>
<dt class="decl">uint <a class="symbol _function" name="Gregorian.getYear" href="./htmlsrc/tango.time.chrono.Gregorian.html#L151" kind="function" beg="151" end="154">getYear</a><span class="params">(Time <em>time</em>)</span>; <span class="attrs">[<span class="stc">override</span>]</span> <a title="Permalink to this symbol" href="#Gregorian.getYear" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.chrono.Gregorian.html#L151">#</a></dt>
<dd class="ddef">
<div class="summary">Overridden. Returns the year in the specified Time.</div>
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>time</em></td><td>A Time value.</td></tr></table>
<p class="sec_header">Returns:</p>An integer representing the year in time.</dd>
<dt class="decl">uint <a class="symbol _function" name="Gregorian.getEra" href="./htmlsrc/tango.time.chrono.Gregorian.html#L161" kind="function" beg="161" end="167">getEra</a><span class="params">(Time <em>time</em>)</span>; <span class="attrs">[<span class="stc">override</span>]</span> <a title="Permalink to this symbol" href="#Gregorian.getEra" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.chrono.Gregorian.html#L161">#</a></dt>
<dd class="ddef">
<div class="summary">Overridden. Returns the era in the specified Time.</div>
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>time</em></td><td>A Time value.</td></tr></table>
<p class="sec_header">Returns:</p>An integer representing the era in time.</dd>
<dt class="decl">uint <a class="symbol _function" name="Gregorian.getDaysInMonth" href="./htmlsrc/tango.time.chrono.Gregorian.html#L177" kind="function" beg="177" end="186">getDaysInMonth</a><span class="params">(uint <em>year</em>, uint <em>month</em>, uint <em>era</em>)</span>; <span class="attrs">[<span class="stc">override</span>]</span> <a title="Permalink to this symbol" href="#Gregorian.getDaysInMonth" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.chrono.Gregorian.html#L177">#</a></dt>
<dd class="ddef">
<div class="summary">Overridden. Returns the number of days in the specified _year and _month of the specified _era.</div>
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>year</em></td><td>An integer representing the _year.</td></tr>
<tr><td><em>month</em></td><td>An integer representing the _month.</td></tr>
<tr><td><em>era</em></td><td>An integer representing the _era.</td></tr></table>
<p class="sec_header">Returns:</p>The number of days in the specified _year and _month of the specified _era.</dd>
<dt class="decl">uint <a class="symbol _function" name="Gregorian.getDaysInYear" href="./htmlsrc/tango.time.chrono.Gregorian.html#L195" kind="function" beg="195" end="198">getDaysInYear</a><span class="params">(uint <em>year</em>, uint <em>era</em>)</span>; <span class="attrs">[<span class="stc">override</span>]</span> <a title="Permalink to this symbol" href="#Gregorian.getDaysInYear" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.chrono.Gregorian.html#L195">#</a></dt>
<dd class="ddef">
<div class="summary">Overridden. Returns the number of days in the specified _year of the specified _era.</div>
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>year</em></td><td>An integer representing the _year.</td></tr>
<tr><td><em>era</em></td><td>An integer representing the _era.</td></tr></table>
<p class="sec_header">Returns:</p>The number of days in the specified _year in the specified _era.</dd>
<dt class="decl">uint <a class="symbol _function" name="Gregorian.getMonthsInYear" href="./htmlsrc/tango.time.chrono.Gregorian.html#L207" kind="function" beg="207" end="210">getMonthsInYear</a><span class="params">(uint <em>year</em>, uint <em>era</em>)</span>; <span class="attrs">[<span class="stc">override</span>]</span> <a title="Permalink to this symbol" href="#Gregorian.getMonthsInYear" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.chrono.Gregorian.html#L207">#</a></dt>
<dd class="ddef">
<div class="summary">Overridden. Returns the number of months in the specified _year of the specified _era.</div>
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>year</em></td><td>An integer representing the _year.</td></tr>
<tr><td><em>era</em></td><td>An integer representing the _era.</td></tr></table>
<p class="sec_header">Returns:</p>The number of months in the specified _year in the specified _era.</dd>
<dt class="decl">bool <a class="symbol _function" name="Gregorian.isLeapYear" href="./htmlsrc/tango.time.chrono.Gregorian.html#L218" kind="function" beg="218" end="221">isLeapYear</a><span class="params">(uint <em>year</em>, uint <em>era</em>)</span>; <span class="attrs">[<span class="stc">override</span>]</span> <a title="Permalink to this symbol" href="#Gregorian.isLeapYear" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.chrono.Gregorian.html#L218">#</a></dt>
<dd class="ddef">
<div class="summary">Overridden. Indicates whether the specified _year in the specified _era is a leap _year.</div>
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>year</em></td><td>An integer representing the _year.</td></tr></table>
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>era</em></td><td>An integer representing the _era.</td></tr></table>
<p class="sec_header">Returns:</p>true is the specified _year is a leap _year; otherwise, false.</dd>
<dt class="decl">Type <a class="symbol _function" name="Gregorian.calendarType" href="./htmlsrc/tango.time.chrono.Gregorian.html#L227" kind="function" beg="227" end="230">calendarType</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#Gregorian.calendarType" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.chrono.Gregorian.html#L227">#</a></dt>
<dd class="ddef">
<div class="summary"><i>Property.</i> Retrieves the GregorianTypes value indicating the language version of the Gregorian.</div>
<p class="sec_header">Returns:</p>The Gregorian.Type value indicating the language version of the Gregorian.</dd>
<dt class="decl">uint[] <a class="symbol _function" name="Gregorian.eras" href="./htmlsrc/tango.time.chrono.Gregorian.html#L236" kind="function" beg="236" end="240">eras</a><span class="params">()</span>; <span class="attrs">[<span class="stc">override</span>]</span> <a title="Permalink to this symbol" href="#Gregorian.eras" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.chrono.Gregorian.html#L236">#</a></dt>
<dd class="ddef">
<div class="summary"><i>Property.</i> Overridden. Retrieves the list of eras in the current calendar.</div>
<p class="sec_header">Returns:</p>An integer array representing the eras in the current calendar.</dd>
<dt class="decl">uint <a class="symbol _function" name="Gregorian.id" href="./htmlsrc/tango.time.chrono.Gregorian.html#L246" kind="function" beg="246" end="249">id</a><span class="params">()</span>; <span class="attrs">[<span class="stc">override</span>]</span> <a title="Permalink to this symbol" href="#Gregorian.id" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.chrono.Gregorian.html#L246">#</a></dt>
<dd class="ddef">
<div class="summary"><i>Property.</i> Overridden. Retrieves the identifier associated with the current calendar.</div>
<p class="sec_header">Returns:</p>An integer representing the identifier of the current calendar.</dd>
<dt class="decl">void <a class="symbol _function" name="Gregorian.split" href="./htmlsrc/tango.time.chrono.Gregorian.html#L257" kind="function" beg="257" end="261">split</a><span class="params">(Time <em>time</em>, ref uint <em>year</em>, ref uint <em>month</em>, ref uint <em>day</em>, ref uint <em>doy</em>, ref uint <em>dow</em>, ref uint <em>era</em>)</span>; <span class="attrs">[<span class="stc">override</span>]</span> <a title="Permalink to this symbol" href="#Gregorian.split" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.chrono.Gregorian.html#L257">#</a></dt>
<dd class="ddef">
<div class="summary">Overridden.  Get the components of a Time structure using the rules
 of the calendar.  This is useful if you want more than one of the
 given components.  Note that this doesn't handle the time of day,
 as that is calculated directly from the Time struct.</div></dd>
<dt class="decl">Time <a class="symbol _function" name="Gregorian.addMonths" href="./htmlsrc/tango.time.chrono.Gregorian.html#L274" kind="function" beg="274" end="308">addMonths</a><span class="params">(Time <em>t</em>, int <em>nMonths</em>)</span>; <span class="attrs">[<span class="stc">override</span>]</span> <a title="Permalink to this symbol" href="#Gregorian.addMonths" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.chrono.Gregorian.html#L274">#</a></dt>
<dd class="ddef">
<div class="summary">Overridden. Returns a new Time with the specified number of months
 added.  If the months are negative, the months are subtracted.</div>
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>t</em></td><td>A time to add the months to</td></tr></table>
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>nMonths</em></td><td>The number of months to add.  This can be
 negative.</td></tr></table>
<p class="sec_header">Returns:</p>A Time that represents the provided time with the number
 of months added.</dd>
<dt class="decl">Time <a class="symbol _function" name="Gregorian.addYears" href="./htmlsrc/tango.time.chrono.Gregorian.html#L322" kind="function" beg="322" end="325">addYears</a><span class="params">(Time <em>t</em>, int <em>nYears</em>)</span>; <span class="attrs">[<span class="stc">override</span>]</span> <a title="Permalink to this symbol" href="#Gregorian.addYears" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.chrono.Gregorian.html#L322">#</a></dt>
<dd class="ddef">
<div class="summary">Overridden.  Add the specified number of years to the given Time.</div>
Note that the Gregorian calendar takes into account that BC time
 is negative, and supports crossing from BC to AD.
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>t</em></td><td>A time to add the years to</td></tr></table>
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>nYears</em></td><td>The number of years to add.  This can be negative.</td></tr></table>
<p class="sec_header">Returns:</p>A Time that represents the provided time with the number
 of years added.</dd></dl></dd></dl>
</div>
<div id="footer">
  <p>Copyright (c) 2005 John Chapman. All rights reserved</p>
  <p>Page generated by <a href="http://code.google.com/p/dil">dil</a> on Fri Dec 26 04:04:12 2008. Rendered by <a href="http://code.google.com/p/dil/wiki/Kandil">kandil</a>.</p>
</div>
</body>
</html>